#include "GlutWindow.h"
#include "GlutViewport.h"
GlutWindow::GlutWindow(char* tile,int w,int h):mTitle(tile),mW(w),mH(h)
{
	mViewport = 0;
}

void GlutWindow::onSize(int w,int h)
{
	Viewport*vp = getViewport();
	vp->setViewport(0,0,w,h);

}

void GlutWindow::render()
{
	glutSwapBuffers();
}

void GlutWindow::onSpecialKey(char c,int x,int y)
{

}

Viewport* GlutWindow::getViewport()
{
	if(mViewport == 0)
	{
		mViewport = new Viewport();
	}
	return mViewport;
}